﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ByHand.Data;
using ByHand.Data.Interfaces;
using ByHand.Model;
using ByHand.Services.Interfaces;

namespace ByHand.Services.Implements
{
    public class GuuAttributeProductService : RepositoryBase<GuuAttributeProduct>, IGuuAttributeProductService
    {
        public GuuAttributeProductService(IDatabaseFactory DbFactory) : base(DbFactory) { }
        public int GetGuuID(int guuProductID, string size, string color) {
            var temp = (from gpa in ByHandDB.GuuAttributeProducts
                        where gpa.Color == color && gpa.Size == size && gpa.GuuProductID == guuProductID
                        select gpa).FirstOrDefault();
            return temp == null ? 0 : (int)temp.GuuID;
        }
    }
}
